Add Object, Interface, and Input type components for rendering GraphQL type declarations.#91
Open
FionaBronwen wants to merge 8 commits into
Open
Add Object, Interface, and Input type components for rendering GraphQL type declarations.#91FionaBronwen wants to merge 8 commits into
FionaBronwen wants to merge 8 commits into
Conversation
Add field-bearing type components that use the Field infrastructure (already present from the parent branch): - ObjectType: renders object types with fields, @compose interfaces, and @operationFields support - InterfaceType: renders interface type definitions with fields - InputType: renders input types with automatic Input suffix when a model appears in both input and output positions 17 new component tests covering: basic field rendering, doc comments, optional/nullable fields, array/list types, deprecated fields, interface implementation via @compose, and Input suffix logic.
…ed imports - Add explanatory comment on getComposition/iface.name in object-type.tsx clarifying that pre-mutation names match post-mutation names (mutation engine doesn't rename models) - Remove unused `type Model` import from all G2 test files
- Add @operationFields test to ObjectType (verifies operation field rendering) - Add nested model reference test to ObjectType (verifies type references) - Add empty model tests to ObjectType, InputType, InterfaceType (documents that GraphQL requires at least one field per type)
The mutation engine now handles all input/output type naming, so components can use type.name directly without looking up whether a model has both input and output variants.
- Remove implementation detail comments about mutation engine - Remove redundant tests that were testing non-responsibility of the component (InputType doesn't add suffixes - that's not its job)
Replace fragile .toContain() assertions with inline snapshots to match TSP ecosystem best practices. This makes test output more readable and maintainable by showing the complete expected SDL in one place.
FionaBronwen
force-pushed
the
feature/graphql
branch
2 times, most recently
from
June 16, 2026 22:19
59ad903 to
7d69aac
Compare
FionaBronwen
force-pushed
the
feature/graphql
branch
from
June 23, 2026 23:17
e9dad03 to
954e220
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ObjectType- Renders GraphQL object types with fields, interface implementations, and operationfields
InterfaceType- Renders GraphQL interface types (models marked with@Interface)InputType- Renders GraphQL input object typesThe mutation engine handles all type naming during mutation, so components can simply use
type.namedirectly.
Changes
New Components
ObjectType (
src/components/types/object-type.tsx)@composedecorator@operationFieldsdecoratorInterfaceType (
src/components/types/interface-type.tsx)@Interfaceas GraphQL interface typesInputType (
src/components/types/input-type.tsx)Simplification
Removed the
modelVariantslookup fromInputTypeandGraphQLTypeExpressionsince the mutationengine now handles all input/output type naming. Components use
type.namedirectly.Test plan
error